<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Gabor
 * Date: 31/03/14
 * Time: 23:11
 * To change this template use File | Settings | File Templates.
 */
class Rectangle implements ISpread, IRenderable
{
    protected $width;

    protected $height;

    protected $color;

    public function getWidth()
    {
        return $this->width;
    }

    public function setWidth($width)
    {
        $this->width = intval($width);
    }

    public function getHeight()
    {
        return $this->height;
    }

    public function setHeight($height)
    {
        $this->height = intval($height);
    }

    public function getColor()
    {
        return $this->color;
    }

    public function setColor($color)
    {
        $this->color = $color;
    }

    public function getArea()
    {
        return $this->width * $this->height;
    }

    public function render()
    {
        return '<div style="width:'.$this->width.'px; height:'.$this->height.'px; background:'.$this->color.';"></div>';
    }
}
